//
//  UICollectionView+CJEnableMove.h
//  TSListDemo
//
//  Created by ciyouzen on 2020/3/26.
//  Copyright © 2020 dvlproad. All rights reserved.
//
//  让集合视图本身就可以通过长按来进行拖动(而不用有其他如编辑的按钮来启动拖动)，并且可选择长按后(即拖动前)是否要有抖动效果

#import <UIKit/UIKit.h>
#import <CJBaseUIKit/UIView+CJShake.h>

NS_ASSUME_NONNULL_BEGIN

@interface UICollectionView (CJEnableMove) {
    
}

#pragma mark - Event
/*
*  让集合视图本身就可以通过长按来进行拖动(而不用有其他如编辑的按钮来启动拖动)，并且可选择长按后(即拖动前)是否要有抖动效果
*
*  @param containShakeEffect        长按后(即拖动前)是否要有抖动效果
    (如果要有抖动效果除了这里containShakeEffect参数传YES外，cellForItemAtIndexPath中还必须
    if (collectionView.cjShakeType == CJShakeTypeMoving) {
        [cell cjShakeKeeping];
 *  @param checkSectionMoveEnableBlock   设置允许哪些section中的哪些item进行拖动操作，未设置则默认都允许
 *  @param checkCellMoveEnableBlock      检查是否允许跨secton操作，未设置则默认允许
 *  @param cellMoveCompleteBlock         移动结束的回调
    })
*/
- (void)cj_enableMoveByLongPressWithShakeEffect:(BOOL)containShakeEffect
                    checkSectionMoveEnableBlock:(BOOL (^ __nullable)(NSIndexPath *indexPath))checkSectionMoveEnableBlock
                       checkCellMoveEnableBlock:(BOOL (^ __nullable)(NSInteger fromSection, NSInteger toSection))checkCellMoveEnableBlock
                          cellMoveCompleteBlock:(void(^ __nullable)(NSIndexPath *sourceIndexPath, NSIndexPath *destinationIndexPath))cellMoveCompleteBlock;

@end

NS_ASSUME_NONNULL_END
